From e50a8e993968af639b8941e3d6c18cd7154b5500 Mon Sep 17 00:00:00 2001 From: "emellor@leeni.uk.xensource.com" Date: Tue, 6 Dec 2005 16:40:43 +0000 Subject: [PATCH] Make the master fd belonging to the pty pair non-blocking. Writes were blocking if the console client disconnected before all the data had been written to the pty, even though the select call had indicated that the fd was previously writable. Reads have been observed exhibiting similar behaviour too. Closes bug #380. Signed-off-by: Ewan Mellor --- tools/console/daemon/io.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c index a26a6560dc..1b49f20c23 100644 --- a/tools/console/daemon/io.c +++ b/tools/console/daemon/io.c @@ -180,6 +180,9 @@ static int domain_create_tty(struct domain *dom) free(path); if (!success) goto out; + + if (fcntl(master, F_SETFL, O_NONBLOCK) == -1) + goto out; } return master; -- 2.30.2